.class Lcom/htc/android/footprints/utils/FootprintDBScanner$1;
.super Ljava/lang/Thread;
.source "FootprintDBScanner.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/htc/android/footprints/utils/FootprintDBScanner;->onReceive(Landroid/content/Context;Landroid/content/Intent;)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field final synthetic this$0:Lcom/htc/android/footprints/utils/FootprintDBScanner;

.field final synthetic val$context:Landroid/content/Context;


# direct methods
.method constructor <init>(Lcom/htc/android/footprints/utils/FootprintDBScanner;Landroid/content/Context;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 29
    iput-object p1, p0, Lcom/htc/android/footprints/utils/FootprintDBScanner$1;->this$0:Lcom/htc/android/footprints/utils/FootprintDBScanner;

    iput-object p2, p0, Lcom/htc/android/footprints/utils/FootprintDBScanner$1;->val$context:Landroid/content/Context;

    invoke-direct {p0}, Ljava/lang/Thread;-><init>()V

    return-void
.end method


# virtual methods
.method public run()V
    .locals 8

    .prologue
    .line 31
    const-wide/16 v4, 0x1e

    :try_start_0
    invoke-static {v4, v5}, Ljava/lang/Thread;->sleep(J)V
    :try_end_0
    .catch Ljava/lang/InterruptedException; {:try_start_0 .. :try_end_0} :catch_0

    .line 35
    :goto_0
    invoke-static {}, Lcom/htc/android/footprints/utils/FootprintUtils;->touchSDFile()V

    .line 36
    new-instance v1, Ljava/io/File;

    invoke-static {}, Lcom/htc/android/footprints/utils/FootprintUtils;->getDBPathOnSD()Ljava/lang/String;

    move-result-object v4

    invoke-direct {v1, v4}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 37
    .local v1, f:Ljava/io/File;
    invoke-virtual {v1}, Ljava/io/File;->exists()Z

    move-result v4

    if-eqz v4, :cond_1

    invoke-virtual {v1}, Ljava/io/File;->length()J

    move-result-wide v4

    const-wide/16 v6, 0x0

    cmp-long v4, v4, v6

    if-lez v4, :cond_1

    invoke-static {}, Lcom/htc/android/footprints/utils/FootprintUtils;->getExtDBVersion()I

    move-result v4

    const/16 v5, 0x24

    if-ne v4, v5, :cond_1

    .line 38
    iget-object v4, p0, Lcom/htc/android/footprints/utils/FootprintDBScanner$1;->val$context:Landroid/content/Context;

    const-string v5, "footprints.db"

    invoke-virtual {v4, v5}, Landroid/content/Context;->getDatabasePath(Ljava/lang/String;)Ljava/io/File;

    move-result-object v2

    .line 41
    .local v2, ftDB:Ljava/io/File;
    invoke-static {v1, v2}, Lcom/htc/android/footprints/utils/FootprintUtils;->copyFile(Ljava/io/File;Ljava/io/File;)Z

    move-result v3

    .line 42
    .local v3, isSuccess:Z
    if-eqz v3, :cond_0

    .line 43
    iget-object v4, p0, Lcom/htc/android/footprints/utils/FootprintDBScanner$1;->val$context:Landroid/content/Context;

    invoke-virtual {v4}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v4

    sget-object v5, Lcom/htc/android/footprints/provider/FootprintsProvider$FootprintColumns;->CONTENT_URI:Landroid/net/Uri;

    const/4 v6, 0x0

    invoke-virtual {v4, v5, v6}, Landroid/content/ContentResolver;->notifyChange(Landroid/net/Uri;Landroid/database/ContentObserver;)V

    .line 48
    .end local v2           #ftDB:Ljava/io/File;
    .end local v3           #isSuccess:Z
    :cond_0
    :goto_1
    return-void

    .line 32
    .end local v1           #f:Ljava/io/File;
    :catch_0
    move-exception v0

    .line 33
    .local v0, e:Ljava/lang/InterruptedException;
    invoke-virtual {v0}, Ljava/lang/InterruptedException;->printStackTrace()V

    goto :goto_0

    .line 46
    .end local v0           #e:Ljava/lang/InterruptedException;
    .restart local v1       #f:Ljava/io/File;
    :cond_1
    iget-object v4, p0, Lcom/htc/android/footprints/utils/FootprintDBScanner$1;->val$context:Landroid/content/Context;

    invoke-static {v4}, Lcom/htc/android/footprints/utils/FootprintUtils;->processPreset(Landroid/content/Context;)V

    goto :goto_1
.end method
